package summer.hot100.v1;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Solution11 {
    public int maxArea(int[] height) {
        int i = 0;
        int j = height.length - 1;
        int res = -1;
        while (i < j) {
            int cur = Math.min(height[i], height[j]) * (j - i);
            res = Math.max(res, cur);
            if (height[i] > height[j]) j--;
            else i++;
        }
        return res;
    }
}
